<?php

function i_suggest_time_for_meeting(){
	$html = '';
	$meet_id = $_GET['meet_id'];
	$meeting = c_get_meet_data($meet_id);
	$suggested_time = suggest_time($meeting);
	$html .= '<div class="wrapper">'.
				'<div class="header"></div>'.
				'<div class="mainPage">'.
					'<h2 style="margin-left:350px;"> Suggest time for meeting</h2>'.
					'<p>&nbsp;</p>'.
					'<table border=" " style="margin-left:250px;">'.
						'<tr>'.
							'<td width="200"><div align="center"><b>Group Name</b></div></td>'.
							'<td width="286">'.$meeting['group_name'].'</td>'.
						'</tr>'.
						'<tr>'.
							'<td><div align="center"><b>Meeting Place</b></div></td>'.
							'<td>'.$meeting['place'].'</td>'.
						'</tr>'.
						'<tr>'.
							'<td>'.
								'<table width="200" border=" ">'.
									'<tr>'.
										'<td><u>Participants</u></td>'.
										'<td><u>Status</u></td>'.
									'</tr>';
	$ci = sizeof($meeting['participants']);
	for($i=0;$i<$ci;$i++){
		$part = $meeting['participants'][$i];
		$status = 'Not ready';
		$style = 'style="color:red;"';
		if($part['status'] == 1){
			$status = 'Ready';
			$style = 'style="color:green;"';
		}
		$html .=					'<tr>'.
										'<td>'.$part['name'].'</td>'.
										'<td '.$style.'>'.$status.'</td>'.
									'</tr>';
	}
	$html .=					'</table>'.
							'</td>'.
							'<td>'.
								'<table width="388" border=" ">'.
									'<tr>'.
										'<td width="80">Minimal time</td>'.
										'<td width="198">'.$meeting['min_time'].'</td>'.
									'</tr>'.
									'<tr>'.
										'<td>Maximal time</td>'.
										'<td>'.$meeting['max_time'].'</td>'.
									'</tr>'.
									'<tr>'.
										'<td>Duration</td>'.
										'<td>'.$meeting['duration'].'h</td>'.
									'</tr>'.
								'</table>'.
							'</td>'.
						'</tr>'.
					'</table>'.
					'<p>&nbsp;</p>'.
					'<form method="post" action="php/core/Suggest_time_for_meeting/p_suggest_time_for_meeting.php" style="margin-left:330px;">'.
						'Suggested meeting time:&nbsp;'.
						'<input type="text" name="time" value="'.$suggested_time['date'].'"/>&nbsp;'.
						'<input type="hidden" name="meet_id" value="'.$meet_id.'"/>'.
						'<input type="submit" name="accept" value="Accept" style="width:70px;"/><br/>'.
						'Number of participants:&nbsp;&nbsp;&nbsp; <b>'.$suggested_time['count'].'</b><br/><br/>'.
						'<a style="margin-left:170px;" href="index.php?id=' . I_GROUP_OVERVIEW . '&grp='.$meeting['group_id'].'">Back</a></p>'.
					'</form>'.
					'<p align="center">&nbsp;</p>'.
				'</div>'.
				'<div class="clear">&nbsp;</div>'.
			'</div>';
	return $html;
} 
?>






	 